<?php 

namespace Admin\Controller;

use Think\Controller;

class LoginController extends Controller{


	public function index(){
		if($_SESSION['user']['id']>0){
			redirect('/admin/index/welcome');
		}
		$this->display('login');
	}

	public function checkout(){
		$account = $_POST['account'];
		$password = $_POST['password'];
		$c = D('Login','Logic');
		$re = $c->check($account,$password);
		if(!$re){
			redirect('/admin/login');
		}
		redirect('/admin/index/welcome');
	}

	public function logout(){
		session_destroy();
		redirect('/admin');
	}

}






























